<?php
/**
 * Created by PhpStorm.
 * User: happydong
 * Date: 2019-07-11
 * Time: 17:12
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class UserPortfolioResource extends Model
{
	protected $table = "user_portfolio_resource";
	protected $fillable = [
		"portfolio_id",
		"resource_id",
		'type',
	];

	protected $hidden = [
		"created_at",
		"updated_at"
	];

	public function picture()
	{
		return $this->hasOne(Picture::class, 'id', 'resource_id');
	}

	public function video(){
		return $this->hasOne(Video::class, 'id', 'resource_id');
	}
}